#include <errno.h>
#include <math.h>
+#include <QtCore/QDir>
+
#include "defs.h"
#include "gbser.h"
#include "gbfile.h" /* used for csv output */
struct mtk_loginfo mtk_info;
const char LIVE_CHAR[4] = {'-', '\\','|','/'};
-static const char TEMP_DATA_BIN[]= "data.bin";
-static const char TEMP_DATA_BIN_OLD[]= "data_old.bin";
-
const char CMD_LOG_DISABLE[]= "$PMTK182,5*20\r\n";
const char CMD_LOG_ENABLE[] = "$PMTK182,4*21\r\n";
}
va_end(ap);
}
+
+// Returns a fully qualified pathname to a temporary file that is a copy
+// of the data downloaded from the device. Only two copies are ever in play,
+// the primary (e.g. "/tmp/data.bin") and the backup ("/tmp/data_old.bin").
+//
+// It returns a temporary C string - it's totally kludged in to replace
+// TEMP_DATA_BIN being string constants.
+static const char* GetTempName(bool backup) {
+ const char kData[]= "data.bin";
+ const char kDataBackup[]= "data_old.bin";
+
+ QString t = QDir::tempPath();
+ t += QDir::separator();
+ t += backup ? kDataBackup : kData;
+ // If your temp directory isn't representable in Latin1, you're going to
+ // have a bad day.
+ return t.toLatin1();
+}
+#define TEMP_DATA_BIN GetTempName(false)
+#define TEMP_DATA_BIN_OLD GetTempName(true)
+
static int do_send_cmd(const char* cmd, int cmdLen)
{
int rc;
frequently pair this with commodity USB/Serial converter internally. So
these devices typically look like Prolific, FTDI, or Silab usb/serial
devices to the host OS. You'll need drivers for that whatever chip
- your product uses for your operating system.
+ your product uses for your operating system. For the "A+ GPS Recorder",
+ the <link linkend="http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx">Silicon Labs CP210x chip</link> is used. On OS/X, you'll get
+ awesome device names like /dev/cu.usbmodem1d13410 - fortunately, our GUI
+ makes that multiple choice so you don't have to guess.
</para>
<para>
Downloaded data will be stored in data.bin file in the current